﻿@model MxTol.Models.FrAnalysisDescripe
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <script src="/Contents/scripts/jquery-1.8.0.min.js" type="text/javascript"></script>
        <script src="/Contents/scripts/functions.js" type="text/javascript"></script>
        <link href="/Contents/css/glassbtn.css" rel="stylesheet" type="text/css" />
        <style type="text/css">
            .left{float:left; width:70px; text-align:right;font-family:微软雅黑;color:#444444;line-height:26px;margin-bottom:12px;}
            .right{float:left;}
            
            .area{border:1px solid #ccc; height:70px; width:350px;text-indent:5px;margin-bottom:12px;}
            .area:hover{border:1px solid #88C5EE; height:70px; width:500px; text-indent:5px;}
            
            .shuru{border:1px solid #ccc; height:23px; width:350px;line-height:23px; text-indent:5px;margin-bottom:12px;}
            .shuru:hover{border:1px solid #88C5EE; height:23px; line-height:23px; text-indent:5px;}
            
            .answer_key{font-family:微软雅黑;width:70px;height:26px;line-height:26px;float:left;}
        </style>
    </head>
    <body style="padding-left:5px;padding-top:5px;">
        <div style="float:left;" >
            <div class="left">题目：</div>
            <div class="right">
                <textarea class="area" id="title" style="width:350px; height:180px;"></textarea>
            </div>
        </div> 
        <div style="float:left;">
            <input type="button" class="greenbtn" style="width:70px;margin-left:140px;margin-top:15px;" value="修改" name="update_btn" onclick="updateDescripe()"/>
        </div>
        <div style="float:left;">
            <input type="button" class="greenbtn" style="width:70px;margin-top:15px;margin-left:35px;" value="取消" name="cancel_btn" onclick="fr_all_closeForm()" />
         </div>
        <script type="text/javascript">
            $(document).ready(function () {
                $("#title").focus();
                $("#title").val("@Model.Title");
            })
            function fr_all_closeForm() {
                parent.closeShade();
            }
            function updateDescripe() {
                var title = trim($("#title").val());

                if (title.length == 0) {
                    alert("请输入题目!");
                }
                else {
                    ajaxUpdateDescripe("@Model.ID",title);
                }
            }
            function ajaxUpdateDescripe(id,title) {
                $.ajax({
                    type: 'POST',
                    url: '/FrAnalysisDescripeManagement/UpdateDescripe?t=' + Math.random(),
                    data: { id:id,title: title },
                    success: function (data) {
                        if (data == "0") {
                            alert("出现未知异常导致修改失败,请重试!");
                        }
                        else if (data == "1") {
                            parent.reload_Analysis_DG();
                        }
                    }
                });
            }
        </script>
    </body>
</html>
